{include file="public/head"/} 
<style>
  #click{
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    position:fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: none;

  }
</style>
  <body>
  <div id="click" onclick="aa()" ></div>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">投诉建议管理</a>
        <a><cite>投诉建议</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
      </div>
      <xblock>
        <!-- <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button> -->
        <button class="layui-btn" onclick="x_admin_show('投诉建议','{:url('admin/Proposal/proposalAdd')}',780,700)"><i class="layui-icon"></i>投诉建议</button>
        <span class="x-right" style="line-height:40px">共有数据：{$number} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th style="width:10%">小区名称</th>
			      <th style="width:15%">地址</th>
            <th style="width:10%">类型</th>
            <th>建议内容</th>
			      <th style="width:10%">图片</th>
            <th style="width:10%">提交时间</th>
           
          </tr>
        </thead>
        <tbody>
          {foreach $list as $lis}
          <tr>
            <td>{$lis.community_name}</td>
            <td>{$lis.room_address}</td>
            <td>
              {if $lis.type == 1}
                  投诉
              {elseif $lis.type == 2}
                  建议
              {elseif $lis.type == 3}
                  表扬
              {/if}
            </td>
            <td>{$lis.content}</td>
			       <td>
              <?php if(!empty($lis["image"])){?>
              <img src="{$lis.image}"  onclick='mag("{$lis.image}")' style="width:40px;height:40px">
              <?php }?>
              
            </td>
            <td>{$lis.time}</td>
            
          </tr>
          {/foreach}
        </tbody>
      </table>
      <div class="page">
        <div id="page">
            {$proposallist->render()}
        </div>
      </div>

    </div>
    <script>
	 let a = document.getElementById("click")
        function mag(url){
            // console.log(123)

            a.style = "display:inline-block;"
            let b = `<img src="`+url+`" style="width:80%;height:80%;text-align:center">`
            a.innerHTML=b
        }
        function aa() {
            a.style = "display:none;"
        }

      // //删除
      // function repairDel(id, doc){
      //   if(confirm('确定要删除吗?')) 
      //   { 
      //     var url = "{:url('repairDel')}?id=" + id
      //     // console.log(url)
      //     $('#' + doc).attr('href', url)
      //   } 
      //     return false; 
      // } 
      function repairSolve(id, doc){
        if(confirm('确定已经解决吗?')) 
        { 
          var url = "{:url('repairSolve')}?id=" + id
          // console.log(url)
          $('#' + doc).attr('href', url)
        } 
          return false; 
      }

    
      
    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  </body>

</html>